import React, { Component } from 'react'

// 7. 导入 store
import store from './store/index'

export default class Page1 extends Component {

    render() {


        // console.log(store.getState());
        const count = store.getState().count

        return (
            <div>
                <h1>Page1 - {count} </h1>

                <button onClick={() => {
                    store.dispatch({
                        type: 'add'
                    })
                }}>加 1</button>
                <button onClick={() => {
                    store.dispatch({
                        type: 'addNum',
                        payload: 5
                    })
                }}>加指定数</button>
            </div>
        )
    }
}
